<template>
    <div class="swiper" :id="sid">
        <div class="swiper-wrapper">
            <slot></slot>
        </div>
    </div>
</template>

<script>
// 引入JS 和 CSS
import Swiper from 'swiper'

export default {
    props: {
        sid: {
            type: String,
            default: 'onebanner'
        },
        options: {
            type: Object,
            default: {
                autoplay: true, // 可选选项，自动滑动
                loop:true,
                speed:3000
            }
        }
    },
    mounted() {
        // 真实DOM
        // 插件的实例化 
        console.log(this.options)
        var mySwiper = new Swiper('#' + this.sid, this.options)
    }
}
</script>